from django.db import models
from backend.utils.models import BaseModel


class Department(BaseModel):
    address = models.CharField(max_length=255, verbose_name='所在地区', null=True, blank=True)
    status = models.BooleanField(default=True, verbose_name='状态')
    remark = models.CharField(max_length=255, verbose_name='备注', null=True, blank=True)
    parent = models.ForeignKey('self', on_delete=models.CASCADE, null=True, blank=True, verbose_name='父级部门',
                               related_name='children')

    class Meta:
        db_table = 'department'
        verbose_name = '部门'
        verbose_name_plural = verbose_name
